<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Playbook - Snapshot</title>
    <link rel="stylesheet" type="text/css" href="https://playbook-ui.github.io/playbook-ios/all.css" media="all" />
</head>
<body>
    <header>
        <a href="https://playbook-ui.github.io/playbook-ios">
            <strong>
                Playbook
            </strong>
            <span>Documentation</span>
        </a>
    </header>

    <!--
    <form class="search">
        <input type="search" placeholder="Search" />
    </form>
    -->

    <nav>
        <div class="wrapper">
            <h2>On This Page</h2>
            <ol><li><a href="#relationships">Relationships</a><ul><li><a href="#relationships">Conforms To</a></li></ul></li><li><a href="#initializers">Initializers</a><ul><li class="initializer"><a href="#snapshot.init(directory:clean:format:timeout:scale:keywindow:devices:viewpreprocessor:)">init(directory:​clean:​format:​timeout:​scale:​key​Window:​devices:​view​Preprocessor:​)</a></li></ul></li><li><a href="#properties">Properties</a><ul><li class="variable"><a href="#snapshot.directory">directory</a></li><li class="variable"><a href="#snapshot.clean">clean</a></li><li class="variable"><a href="#snapshot.format">format</a></li><li class="variable"><a href="#snapshot.timeout">timeout</a></li><li class="variable"><a href="#snapshot.scale">scale</a></li><li class="variable"><a href="#snapshot.keywindow">key​Window</a></li><li class="variable"><a href="#snapshot.devices">devices</a></li><li class="variable"><a href="#snapshot.viewpreprocessor">view​Preprocessor</a></li></ul></li><li><a href="#methods">Methods</a><ul><li class="function"><a href="#snapshot.run(with:)">run(with:​)</a></li></ul></li></ol>
        </div>
    </nav>

    <main>
        <article>
            <h1>
    <small>Structure</small>
    <code class="name">Snapshot</code>
</h1>

<div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">struct</span> <span class="type">Snapshot</span>: <a href="https://playbook-ui.github.io/playbook-ios/TestTool"><span class="type">TestTool</span></a>  </body></html></code></pre>
</div>
<div class="summary" role="doc-abstract">
    <p>The testing tool which generates snapshot images from scenarios managed by <code>Playbook</code>.</p>

</div>
<section id="relationships">
    <h2 hidden>Relationships</h2>
        <figure>
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
 "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by graphviz version 2.47.1 (20210417.1919)
 -->
<!-- Pages: 1 -->
<svg width="872pt" height="116pt"
 viewBox="0.00 0.00 872.00 116.00" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 112)">
<polygon fill="white" stroke="transparent" points="-4,4 -4,-112 868,-112 868,4 -4,4"/>
<!-- Snapshot -->
<g id="node1" class="node structure current">
<title>Snapshot</title>
<g id="a_node1"><a xlink:href="https://playbook-ui.github.io/playbook-ios/Snapshot" xlink:title="Snapshot">
<path fill="none" stroke="black" stroke-width="3" d="M528,-108C528,-108 336,-108 336,-108 330,-108 324,-102 324,-96 324,-96 324,-84 324,-84 324,-78 330,-72 336,-72 336,-72 528,-72 528,-72 534,-72 540,-78 540,-84 540,-84 540,-96 540,-96 540,-102 534,-108 528,-108"/>
<text text-anchor="middle" x="432" y="-86.3" font-family="Menlo" font-size="14.00">Snapshot</text>
</a>
</g>
</g>
<!-- TestTool -->
<g id="node2" class="node protocol">
<title>TestTool</title>
<g id="a_node2"><a xlink:href="https://playbook-ui.github.io/playbook-ios/TestTool" xlink:title="TestTool">
<path fill="none" stroke="black" d="M528,-36C528,-36 336,-36 336,-36 330,-36 324,-30 324,-24 324,-24 324,-12 324,-12 324,-6 330,0 336,0 336,0 528,0 528,0 534,0 540,-6 540,-12 540,-12 540,-24 540,-24 540,-30 534,-36 528,-36"/>
<text text-anchor="middle" x="432" y="-14.3" font-family="Menlo" font-size="14.00">TestTool</text>
</a>
</g>
</g>
<!-- Snapshot&#45;&gt;TestTool -->
<g id="edge1" class="edge conformsTo">
<title>Snapshot&#45;&gt;TestTool</title>
<path fill="none" stroke="black" d="M432,-71.7C432,-63.98 432,-54.71 432,-46.11"/>
<polygon fill="black" stroke="black" points="435.5,-46.1 432,-36.1 428.5,-46.1 435.5,-46.1"/>
</g>
</g>
</svg>


    <figcaption hidden>Inheritance graph for Snapshot.</figcaption>
</figure>
        <h3>Conforms To</h3>
<dl>
    <dt class="protocol"><code><a href="https://playbook-ui.github.io/playbook-ios/TestTool">TestTool</a></code></dt>
<dd><p>Represents a tool for testing scenarios managed by playbooks.</p>
</dd>
</dl>
</section>
    <section id="initializers">
        <h2>Initializers</h2>

        <div role="article" class="initializer" id="snapshot.init(directory:clean:format:timeout:scale:keywindow:devices:viewpreprocessor:)">
    <h3>
        <code><a href="#snapshot.init(directory:clean:format:timeout:scale:keywindow:devices:viewpreprocessor:)">init(directory:​clean:​format:​timeout:​scale:​key​Window:​devices:​view​Preprocessor:​)</a></code>
    </h3>
    <div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">init</span>(
        <span class="variable">directory</span>: <span class="type">URL</span>,
        <span class="variable">clean</span>: <span class="type">Bool</span> = <span class="keyword">false</span>,
        <span class="variable">format</span>: <a href="https://playbook-ui.github.io/playbook-ios/SnapshotSupport"><span class="type">SnapshotSupport</span></a>.<span class="type">ImageFormat</span>,
        <span class="variable">timeout</span>: <span class="type">TimeInterval</span> = <span class="number literal">600</span>,
        <span class="variable">scale</span>: <span class="type">CGFloat</span> = <span class="variable">UIScreen</span>.<span class="variable">main</span>.<span class="variable">scale</span>,
        <span class="variable">keyWindow</span>: <span class="type">UIWindow</span>? = <span class="keyword">nil</span>,
        <span class="variable">devices</span>: [<a href="https://playbook-ui.github.io/playbook-ios/SnapshotDevice"><span class="type">SnapshotDevice</span></a>],
        <span class="variable">viewPreprocessor</span>: ((<span class="type">UIView</span>) -&gt; <span class="type">UIView</span>)? = <span class="keyword">nil</span>
    )  </body></html></code></pre>
</div>
<div class="summary" role="doc-abstract">
    <p>Creates a new snapshot tool for export all image files into specified directory.</p>

</div>
<h4>Parameters</h4>

<table class="parameters">
  <thead hidden>
  <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Description</th>
  </tr>
  </thead>
  <tbody>
    <tr>
    <th>directory</th>
    <td><code class="type">URL</code></td>
    <td><p>A base directory for exporting snapshot image files.</p>
</td>
</tr>
<tr>
    <th>clean</th>
    <td><code class="type">Bool</code></td>
    <td><p>Specifies whether to clean directory before generating snapshots.</p>
</td>
</tr>
<tr>
    <th>format</th>
    <td><code class="type">Snapshot​Support.​Image​Format</code></td>
    <td><p>An image file format of exported data.</p>
</td>
</tr>
<tr>
    <th>timeout</th>
    <td><code class="type">Time​Interval</code></td>
    <td><p>A timeout interval until the finish snapshot of all scenarios.</p>
</td>
</tr>
<tr>
    <th>scale</th>
    <td><code class="type">CGFloat</code></td>
    <td><p>A rendering scale of the snapshot image.</p>
</td>
</tr>
<tr>
    <th>key​Window</th>
    <td><code class="type">UIWindow?</code></td>
    <td><p>The key window of the application.</p>
</td>
</tr>
<tr>
    <th>devices</th>
    <td><code class="type">[Snapshot​Device]</code></td>
    <td><p>A set of snapshot environment simulating devices.</p>
</td>
</tr>
<tr>
    <th>view​Preprocessor</th>
    <td><code class="type">((UIView) -&gt; UIView)?</code></td>
    <td><p>A closure to preprocess scenario UIView before generating snapshot.</p>
</td>
</tr>
  </tbody>
</table>
</div>
    </section>
    <section id="properties">
        <h2>Properties</h2>

        <div role="article" class="variable" id="snapshot.directory">
    <h3>
        <code><a href="#snapshot.directory">directory</a></code>
    </h3>
    <div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">directory</span>: <span class="type">URL</span></body></html></code></pre>
</div>
<div class="summary" role="doc-abstract">
    <p>A base directory for exporting snapshot image files.</p>

</div>
</div>
<div role="article" class="variable" id="snapshot.clean">
    <h3>
        <code><a href="#snapshot.clean">clean</a></code>
    </h3>
    <div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">clean</span>: <span class="type">Bool</span></body></html></code></pre>
</div>
<div class="summary" role="doc-abstract">
    <p>Specifies whether that to clean directory before generating snapshots.</p>

</div>
</div>
<div role="article" class="variable" id="snapshot.format">
    <h3>
        <code><a href="#snapshot.format">format</a></code>
    </h3>
    <div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">format</span>: <a href="https://playbook-ui.github.io/playbook-ios/SnapshotSupport"><span class="type">SnapshotSupport</span></a>.<span class="type">ImageFormat</span></body></html></code></pre>
</div>
<div class="summary" role="doc-abstract">
    <p>An image file format of exported data.</p>

</div>
</div>
<div role="article" class="variable" id="snapshot.timeout">
    <h3>
        <code><a href="#snapshot.timeout">timeout</a></code>
    </h3>
    <div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">timeout</span>: <span class="type">TimeInterval</span></body></html></code></pre>
</div>
<div class="summary" role="doc-abstract">
    <p>A timeout interval until the finish snapshot of all scenarios.</p>

</div>
</div>
<div role="article" class="variable" id="snapshot.scale">
    <h3>
        <code><a href="#snapshot.scale">scale</a></code>
    </h3>
    <div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">scale</span>: <span class="type">CGFloat</span></body></html></code></pre>
</div>
<div class="summary" role="doc-abstract">
    <p>A rendering scale of the snapshot image.</p>

</div>
</div>
<div role="article" class="variable" id="snapshot.keywindow">
    <h3>
        <code><a href="#snapshot.keywindow">key​Window</a></code>
    </h3>
    <div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="attribute">weak</span> <span class="keyword">var</span> <span class="variable">keyWindow</span>: <span class="type">UIWindow</span>? </body></html></code></pre>
</div>
<div class="summary" role="doc-abstract">
    <p>The key window of the application.</p>

</div>
</div>
<div role="article" class="variable" id="snapshot.devices">
    <h3>
        <code><a href="#snapshot.devices">devices</a></code>
    </h3>
    <div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">devices</span>: [<a href="https://playbook-ui.github.io/playbook-ios/SnapshotDevice"><span class="type">SnapshotDevice</span></a>] </body></html></code></pre>
</div>
<div class="summary" role="doc-abstract">
    <p>A set of snapshot environment simulating devices.</p>

</div>
</div>
<div role="article" class="variable" id="snapshot.viewpreprocessor">
    <h3>
        <code><a href="#snapshot.viewpreprocessor">view​Preprocessor</a></code>
    </h3>
    <div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">var</span> <span class="variable">viewPreprocessor</span>: ((<span class="type">UIView</span>) -&gt; <span class="type">UIView</span>)? </body></html></code></pre>
</div>
<div class="summary" role="doc-abstract">
    <p>A closure to preprocess scenario UIView before generating snapshot.</p>

</div>
</div>
    </section>
    <section id="methods">
        <h2>Methods</h2>

        <div role="article" class="function" id="snapshot.run(with:)">
    <h3>
        <code><a href="#snapshot.run(with:)">run(with:​)</a></code>
    </h3>
    <div class="declaration">
<pre class="highlight"><code><html><body><span class="keyword">public</span> <span class="keyword">func</span> <span class="function">run</span>(<span class="variable">with</span> <span class="variable">playbook</span>: <a href="https://playbook-ui.github.io/playbook-ios/Playbook"><span class="type">Playbook</span></a>) <span class="keyword">throws</span>  </body></html></code></pre>
</div>
<div class="summary" role="doc-abstract">
    <p>Generates snapshot images for passed <code>Playbook</code> instance.</p>

</div>
<h4>Parameters</h4>

<table class="parameters">
  <thead hidden>
  <tr>
      <th>Name</th>
      <th>Type</th>
      <th>Description</th>
  </tr>
  </thead>
  <tbody>
    <tr>
    <th>playbook</th>
    <td><code class="type">Playbook</code></td>
    <td><p>A <code>Playbook</code> instance to be tested.</p>
</td>
</tr>
  </tbody>
</table>
</div>
    </section>



        </article>
    </main>

    <footer>
        <p>
    Generated on <time datetime="2021-08-25T19:01:54+0900">August 25, 2021</time> using <a href="https://github.com/SwiftDocOrg/swift-doc">swift-doc</a> <span class="version">1.0.0-rc.1</span>.
</p>
    </footer>
</body>
</html>
